﻿@model CommerceOne.Widgets.Paging.PagingViewModel
           
<!-- Pagination -->
<div id="pagination" class="pagination">
    <ul class="pagination">
        @if (Model.PreviousLink != null)
        {
            <li id="pagination_previous"><a href="@Model.PreviousLink.Address">&laquo;&nbsp;Previous</a></li>
        }
        else
        {
            <li id="pagination_previous" class="disabled"><span>&laquo;&nbsp;Previous</span></li>
        }

        @foreach (var item in Model.Pages)
        {
            if (item.IsCurrenPage)
            {
                <li class="current item"><span>@item.Text</span></li>
            }
            else
            {
                <li class="item"><a href="@item.Address">@item.Text</a></li>
            }

        }

        @if (Model.NextLink != null)
        {
            <li id="pagination_next"><a href="@Model.NextLink.Address">Next&nbsp;&raquo;</a></li>
        }
        else
        {
            <li id="pagination_next" class="disabled"><span>Next&nbsp;&raquo;</span></li>
        }
    </ul>
</div>
<!-- /Pagination -->
